// 时间戳转普通时间格式
export default function (value, type = 'date') {
    const date = new Date(+value),
        year = date.getFullYear(),
        month = (date.getMonth() + 1 + '').padStart(2, '0'),
        day = (date.getDate() + '').padStart(2, '0')
    if (type === 'date') {
        return `${year}-${month}-${day}`
    } else if (type === 'time') {
        const hour = (date.getHours() + '').padStart(2, '0'),
            minute = (date.getMinutes() + '').padStart(2, '0')
        return `${year}-${month}-${day}  ${hour}:${minute}`
    }
}